<template>
  <div>
    <!-- 溢缴款查询列表 -->
    <div class="overPaymentList" v-if="vif_overPaymentList">
      <el-form inline label-width="100px" label-position="left">
        <el-row>
          <el-form-item label="批次号：">
            <el-input v-model="objForm.pch" placeholder=""></el-input>
          </el-form-item>
          <el-form-item label="汇款日期：" style="width: 282.5px">
            <el-date-picker
              v-model="objForm.remitDt"
              type="date"
              placeholder="选择日期"
            >
            </el-date-picker>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="汇款人名称：">
            <el-input v-model="objForm.remitName" placeholder=""></el-input>
          </el-form-item>
          <el-form-item label="汇款人账号：">
            <el-input v-model="objForm.remitAcc" placeholder=""></el-input>
          </el-form-item>
        </el-row>

        <el-row>
          <el-form-item label="汇款金额：">
            <el-input
              v-model="objForm.hkje_start"
              style="width: 100px"
            ></el-input>
            <span> — </span>
            <el-input
              v-model="objForm.hkje_end"
              style="width: 100px"
            ></el-input>
          </el-form-item>
          <el-form-item label="交易类型：">
            <el-select
              v-model="objForm.jylx"
              placeholder="请选择"
              style="width: 100%"
            >
              <el-option
                v-for="item in jylxOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-row>

        <el-row>
          <el-form-item label="还款类型：">
            <el-select
              v-model="objForm.hklx"
              placeholder="请选择"
              style="width: 100%"
            >
              <el-option
                v-for="item in hklxOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="提交标志：">
            <el-select
              v-model="objForm.tjbz"
              placeholder="请选择"
              style="width: 100%"
            >
              <el-option
                v-for="item in tjbzOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="录入日期：">
            <el-date-picker
              v-model="objForm.lrrq"
              type="datetimerange"
              range-separator="至"
              start-placeholder=""
              end-placeholder=""
            >
            </el-date-picker>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item style="padding-top: 20px; float: left; width: 76px">
            <el-button type="primary" @click="queryOverPayment" size="medium"
              >查询</el-button
            >
          </el-form-item>
          <el-form-item style="padding-top: 20px; float: left; width: 76px">
            <el-button type="primary" @click="restAll" size="medium"
              >重置</el-button
            >
          </el-form-item>
          <el-form-item style="padding-top: 20px; float: left; width: 76px">
            <el-button type="primary" @click="claim" size="medium"
              >认领</el-button
            >
          </el-form-item>
          <el-form-item style="padding-top: 20px; float: left; width: 76px">
            <el-button type="primary" @click="claim2" size="medium"
              >集团认领</el-button
            >
          </el-form-item>
        </el-row>
      </el-form>

      <el-table
        :data="overPaymentData"
        title="溢缴款查询列表"
        border
        height="300"
        stripe="true"
        style="width: 200%"
      >
        <el-table-column label="序号" width="50" type="index" />
        <el-table-column prop="pch" label="批次号" width="120" align="center" />
        <el-table-column
          prop="jylsh"
          label="交易流水号"
          width="120"
          align="center"
        />
        <el-table-column
          prop="hkrq"
          label="汇款日期"
          width="120"
          align="center"
        />
        <el-table-column
          prop="hkrzh"
          label="汇款人账号"
          width="120"
          align="center"
        />
        <el-table-column
          prop="hkrkhh"
          label="汇款人开户行"
          width="120"
          align="center"
        />
        <el-table-column
          prop="skzh"
          label="收款账号"
          width="120"
          align="center"
        />
        <el-table-column
          prop="hkje"
          label="汇款金额"
          width="120"
          align="center"
        />
        <el-table-column
          prop="drlje"
          label="待认领金额"
          width="120"
          align="center"
        />
        <el-table-column
          prop="jylx"
          label="交易类型"
          width="120"
          align="center"
        />
        <el-table-column
          prop="sfbl"
          label="是否补录"
          width="120"
          align="center"
        />
        <el-table-column
          prop="hklx"
          label="还款类型"
          width="120"
          align="center"
        />
        <el-table-column
          prop="rlzt"
          label="认领状态"
          width="120"
          align="center"
        />
        <el-table-column
          prop="tjbz"
          label="提交标志"
          width="120"
          align="center"
        />
        <el-table-column
          prop="spbz"
          label="交易流水号"
          width="审批状态"
          align="center"
        />
      </el-table>
      <div class="overPaymentPageNumber">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage"
          :page-sizes="[10, 20, 30, 40, 50]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          style="float: right"
        >
        </el-pagination>
      </div>
    </div>

    <!----------------------------------------------- 溢缴款认领（个人） ------------------------------------------->
    <div class="overPaymentClaimPersonal" v-if="vif_overPaymentCliam1">
      <div>
        <el-form
          label-width="140px"
          label-position="right"
          :model="objFormClaim1"
          :rules="rules1"
          ref="objFormClaim1"
        >
          <el-row :span="0">
            <el-col :span="10">
              <el-form-item label="交易流水号：" prop="jylsh">
                <el-input
                  style="width: 140px"
                  v-model="objFormClaim1.jylsh"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="汇款金额：">
                <el-input
                  style="width: 140px"
                  v-model="objFormClaim1.hkje"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="汇款人名称：" prop="remitName">
                <el-input
                  style="width: 140px"
                  v-model="objFormClaim1.remitName"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="汇款日期：" prop="remitDt">
                <el-date-picker
                  v-model="objFormClaim1.remitDt"
                  type="date"
                  placeholder="选择日期"
                  style="width: 140px"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="付款人账号：" prop="remitAcc">
                <el-input
                  style="width: 140px"
                  v-model="objFormClaim1.remitAcc"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="转入方式：">
                <el-input
                  style="width: 140px"
                  v-model="objFormClaim1.zrfs"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="业务类型：">
                <el-select
                  v-model="objFormClaim1.ywlx"
                  placeholder="请选择"
                  style="width: 140px"
                >
                  <el-option
                    v-for="item in ywlxOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="汇款人开户行：">
                <el-select
                  v-model="objFormClaim1.hkrkhh"
                  placeholder="请选择"
                  style="width: 140px"
                >
                  <el-option
                    v-for="item in hkrkhhOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="还款认领日期：">
                <el-date-picker
                  v-model="objFormClaim1.hkrkrq"
                  type="date"
                  placeholder="选择日期"
                  style="width: 140px"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="还款类型：" prop="hklx">
                <el-select
                  v-model="objFormClaim1.hklx"
                  placeholder="请选择"
                  style="width: 140px"
                >
                  <el-option
                    v-for="item in hklxOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="是否包含催收费用：">
                <el-radio v-model="objFormClaim1.sfbhcsfy" label="是"
                  >是</el-radio
                >
                <el-radio v-model="objFormClaim1.sfbhcsfy" label="否"
                  >否</el-radio
                >
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="资金来源：" prop="zjly">
                <el-select
                  v-model="objFormClaim1.zjly"
                  placeholder="请选择"
                  style="width: 140px"
                >
                  <el-option
                    v-for="item in zjlyOptions"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>

      <span style="color: black; font-size: 20px">溢缴款认领账户</span>
      <el-divider />
      <el-button type="primary" @click="add" size="large">添加</el-button>
      <div style="padding-top: 10px; margin-bottom: 50px">
        <el-table
          :data="overPaymentClaimData1"
          title="溢缴款认领列表"
          border
          height="300"
          stripe="true"
          style="width: 100%"
        >
          <el-table-column label="序号" width="50" type="index" />
          <el-table-column
            v-for="(item, index) in overPaymentClaimData1List"
            :prop="item.value"
            :label="item.key"
            :key="index"
            width="120"
            align="center"
            v-if="item.key !== 'editing'"
          >
            <template slot-scope="scope">
              <template
                v-if="
                  !scope.row.editing ||
                  item.value === 'zjlx' ||
                  item.value === 'rlfs' ||
                  item.value === 'zt'
                "
              >
                <span>{{ scope.row[item.value] }}</span>
              </template>
              <template v-else>
                <el-input v-model="scope.row[item.value]"></el-input>
              </template>
            </template>
          </el-table-column>

          <!-- <el-table-column prop="khh" label="客户号" width="120" align="center">
            <template slot-scope="scope">
              <el-input v-model="scope.row.khh"></el-input>
          </template>
          </el-table-column>
          <el-table-column prop="khmc" label="客户名称" width="120" align="center" />
          <el-table-column prop="zjlx" label="证件类型" width="120" align="center" />
          <el-table-column prop="idNo" label="证件号码" width="120" align="center" />
          <el-table-column prop="sjhm" label="手机号码" width="120" align="center" />
          <el-table-column prop="jjh" label="借据号" width="120" align="center" />
          <el-table-column prop="fkqd" label="放宽渠道" width="120" align="center" />
          <el-table-column prop="claAmt" label="认领金额" width="120" align="center" />
          <el-table-column prop="hkje" label="汇款金额" width="120" align="center" />
          <el-table-column prop="rlfs" label="认领方式" width="120" align="center" />
          <el-table-column prop="zt" label="状态" width="120" align="center" /> -->
        </el-table>
        <el-pagination
          @size-change="handleSizeChange_Claim1"
          @current-change="handleCurrentChange_Claim1"
          :current-page="currentPage_Claim1"
          :page-sizes="[10, 20, 30, 40, 50]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total_Claim1"
          style="float: right"
        >
        </el-pagination>
      </div>

      <div style="float: right">
        <!-- <el-button  type="primary"  @click="claim_Save_Personal" size="medium">保存</el-button> -->
        <el-button type="primary" @click="claim_Submit_Personal" size="medium"
          >提交</el-button
        >
        <el-button type="primary" @click="claim_Shut_Personal" size="medium"
          >关闭</el-button
        >
      </div>
    </div>

    <!----------------------------------------------- 溢缴款认领（集团） ------------------------------------------->
    <div class="overPaymentClaimGroup" v-if="vif_overPaymentCliam2">
      <div style="padding-left: 120px">
        <el-form
          label-width="110px"
          label-position="right"
          :model="objFormClaim2"
          :rules="rules2"
          ref="objFormClaim2"
        >
          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="交易流水号：" prop="jylsh">
                <el-input
                  style="width: 200px"
                  v-model="objFormClaim2.jylsh"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="汇款金额：">
                <el-input
                  style="width: 200px"
                  v-model="objFormClaim2.hkje"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="汇款人名称：" prop="remitName">
                <el-input
                  style="width: 200px"
                  v-model="objFormClaim2.remitName"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="汇款日期：" prop="remitDt">
                <el-date-picker
                  v-model="objFormClaim2.remitDt"
                  type="date"
                  placeholder="选择日期"
                  style="width: 200px"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="付款人账号：" prop="remitAcc">
                <el-input
                  style="width: 200px"
                  v-model="objFormClaim2.remitAcc"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="转入方式：">
                <el-input
                  style="width: 200px"
                  v-model="objFormClaim2.zrfs"
                  placeholder=""
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="业务类型：">
                <el-select
                  v-model="objFormClaim2.ywlx"
                  placeholder="请选择"
                  style="width: 200px"
                >
                  <el-option
                    v-for="item in ywlx2Options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="汇款人开户行：">
                <el-select
                  v-model="objFormClaim2.hkrkhh"
                  placeholder="请选择"
                  style="width: 200px"
                >
                  <el-option
                    v-for="item in hkrkhh2Options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="还款认领日期：">
                <el-date-picker
                  v-model="objFormClaim2.hkrkrq"
                  type="date"
                  placeholder="选择日期"
                  style="width: 200px"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="还款类型：" prop="hklx">
                <el-select
                  v-model="objFormClaim2.hklx"
                  placeholder="请选择"
                  style="width: 200px"
                >
                  <el-option
                    v-for="item in hklx2Options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :span="20">
            <el-col :span="10">
              <el-form-item label="汇款类型" prop="huiklx">
                <el-select
                  v-model="objFormClaim2.huiklx"
                  placeholder="请选择"
                  style="width: 200px"
                >
                  <el-option
                    v-for="item in hklx2Options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                    style="width: 200px"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <span style="color: black; font-size: 20px">溢缴款认领账户</span>
      <el-divider />
      <el-button type="primary" @click="add2" size="large">添加</el-button>
      <div style="padding-top: 20px; margin-bottom: 50px">
        <el-table
          :data="overPaymentClaimData2"
          title="溢缴款认领列表"
          border
          height="300"
          stripe="true"
          style="width: 100%"
        >
          <el-table-column label="序号" width="50" type="index" />
          <el-table-column
            v-for="(item, index) in overPaymentClaimData2List"
            :prop="item.value"
            :label="item.key"
            :key="index"
            width="105"
            align="center"
            v-if="item.key !== 'editing'"
          >
            <template slot-scope="scope">
              <template
                v-if="
                  !scope.row.editing ||
                  item.value === 'zjlx' ||
                  item.value === 'rlrq' ||
                  item.value === 'rlzt' ||
                  item.value === 'hklx'
                "
              >
                <span>{{ scope.row[item.value] }}</span>
              </template>
              <template v-else>
                <el-input v-model="scope.row[item.value]"></el-input>
              </template>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          @size-change="handleSizeChange_Claim2"
          @current-change="handleCurrentChange_Claim2"
          :current-page="currentPage_Claim2"
          :page-sizes="[10, 20, 30, 40, 50]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total_Claim2"
          style="float: right"
        >
        </el-pagination>
      </div>

      <div style="float: right">
        <!-- <el-button  type="primary"  @click="claim_Save_Grouo" size="medium">保存</el-button> -->
        <el-button type="primary" @click="claim_Submit_Group" size="medium"
          >提交</el-button
        >
        <el-button type="primary" @click="claim_Shut_Group" size="medium"
          >关闭</el-button
        >
      </div>
    </div>
  </div>
</template>

  <script>
import {
  claimCMIS200063,
  queryRepayAccount,
} from "@/api/hubeixiaojin/queryInfo";

export default {
  name: "overPayManage",
  props: ["data"],
  data() {
    return {
      minValue: 0,
      maxValue: 100,
      vif_overPaymentList: true,
      vif_overPaymentCliam1: false,
      vif_overPaymentCliam2: false,
      jylxOptions: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      hklxOptions: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      ywlxOptions: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      ywlx2Options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      hklxOptions: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      hklx2Options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      zjlyOptions: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      hkrkhhOptions: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      hkrkhh2Options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      tjbzOptions: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶 ",
        },
      ],

      objForm: {
        pch: "",
        remitDt: "",
        remitName: "",
        remitAcc: "",
        hkje: "",
        jylx: "",
        tjbz: "",
        hklx: "",
        tjbz: "",
        lrrq: "",
      },
      overPaymentData: [],
      objFormClaim1: {
        jylsh: "",
        hkje: "",
        remitName: "",
        remitDt: "",
        remitAcc: "",
        zrfs: "",
        ywlx: "",
        hkrkhh: "",
        hkrkrq: "",
        hklx: "",
        zjly: "",
      },
      rules1: {
        jylsh: [
          { required: true, message: "请输入交易流水号", trigger: "blur" },
        ],
        remitName: [
          { required: true, message: "请输入汇款人名称", trigger: "blur" },
        ],
        remitDt: [
          { required: true, message: "请输入汇款日期", trigger: "blur" },
        ],
        hklx: [{ required: true, message: "请输入还款类型", trigger: "blur" }],
        zjly: [{ required: true, message: "请输入资金来源", trigger: "blur" }],
        remitAcc: [
          { required: true, message: "请输入付款人账号", trigger: "blur" },
        ],
      },
      //overPaymentClaimData1:[{'khh':'111','khmc':'drx'}],
      overPaymentClaimData1: [],
      overPaymentClaimData1List: [
        {
          key: "客户号",
          value: "khh",
        },
        {
          key: "客户名称",
          value: "khmc",
        },
        {
          key: "证件类型",
          value: "zjlx",
        },
        {
          key: "证件号码",
          value: "idNo",
        },
        {
          key: "手机号码",
          value: "sjhm",
        },
        {
          key: "借据号",
          value: "jjh",
        },
        {
          key: "放宽渠道",
          value: "fkqd",
        },
        {
          key: "认领金额",
          value: "claAmt",
        },
        {
          key: "汇款金额",
          value: "hkje",
        },
        {
          key: "认领方式",
          value: "rlfs",
        },
        {
          key: "状态",
          value: "zt",
        },
        {
          key: "editing",
          value: "editing",
        },
      ],
      objFormClaim2: {
        jylsh: "",
        hkje: "",
        remitName: "",
        remitDt: "",
        remitAcc: "",
        zrfs: "",
        ywlx: "",
        hkrkhh: "",
        hkrkrq: "",
        hklx: "",
        huiklx: "",
      },
      rules2: {
        jylsh: [
          { required: true, message: "请输入交易流水号", trigger: "blur" },
        ],
        remitName: [
          { required: true, message: "请输入汇款人名称", trigger: "blur" },
        ],
        remitDt: [
          { required: true, message: "请输入汇款日期", trigger: "blur" },
        ],
        hklx: [{ required: true, message: "请输入还款类型", trigger: "blur" }],
        huiklx: [
          { required: true, message: "请输入汇款类型", trigger: "blur" },
        ],
        remitAcc: [
          { required: true, message: "请输入付款人账号", trigger: "blur" },
        ],
      },
      //overPaymentClaimData2:[{'khh':'111','khmc':'drx'}],
      overPaymentClaimData2: [],
      overPaymentClaimData2List: [
        {
          key: "客户号",
          value: "khh",
        },
        {
          key: "客户名称",
          value: "khmc",
        },
        {
          key: "证件类型",
          value: "zjlx",
        },
        {
          key: "证件号码",
          value: "idNo",
        },
        {
          key: "认领金额",
          value: "claAmt",
        },
        {
          key: "认领日期",
          value: "rlrq",
        },
        {
          key: "认领状态",
          value: "rlzt",
        },
        {
          key: "还款类型",
          value: "hklx",
        },
        {
          key: "editing",
          value: "editing",
        },
      ],
      currentPage: 1,
      total: 0,
      currentPage_Claim1: 1,
      total_Claim1: 0,
      currentPage_Claim2: 1,
      total_Claim2: 0,
      size: 0,
      size2: 0,
    };
  },

  created() {
    console.log("溢缴款查询模块初始化：");
    var zjhm = sessionStorage.getItem("idNo"); //身份证号
    this.queryInfo(zjhm);
  },

  watch: {
    $route: function (to, from) {
      console.log("监听【溢缴款查询模块】route变化");
      this.$destroy();
    },
  },

  methods: {
    //查询
    queryInfo() {
      console.log("开始查询溢缴款：");
    },

    //重置
    restAll() {
      console.log("重置【溢缴款管理】页面数据");
      this.objForm = {};
      this.overPaymentData = [];
    },

    //溢缴款认领：
    claim() {
      //隐藏溢缴款查询列表，展示溢缴款认领列表
      this.vif_overPaymentList = false;
      this.vif_overPaymentCliam1 = true;
      this.vif_overPaymentCliam2 = false;
    },
    claim2() {
      //隐藏溢缴款查询列表，展示溢缴款认领列表
      this.vif_overPaymentList = false;
      this.vif_overPaymentCliam1 = false;
      this.vif_overPaymentCliam2 = true;
    },

    //溢缴款认领(个人) 添加
    add() {
      this.overPaymentClaimData1.push({
        khh: "",
        khmc: "",
        zjlx: "",
        idNo: "",
        sjhm: "",
        jjh: "",
        fkqd: "",
        claAmt: "",
        hkje: "",
        rlfs: "",
        zt: "",
        editing: true,
      });
      this.size = this.overPaymentClaimData1.length - 1;
    },
    //溢缴款认领(个人) 保存
    claim_Save_Personal() {},
    //溢缴款认领(个人) 提交
    claim_Submit_Personal() {
      console.log("溢缴款认领__个人");
      this.$refs["objFormClaim1"].validate((valid) => {
        if (valid) {
          //console.log(this.overPaymentClaimData1[this.size].fkqd)
          if (
            !this.overPaymentClaimData1[this.size].idNo &&
            this.overPaymentClaimData1[this.size].idNo.length <= 0
          ) {
            window.globalUiKit.notify("提示", "请输入认领人证件号码", "error");
            return;
          }
          if (
            !this.overPaymentClaimData1[this.size].fkqd &&
            this.overPaymentClaimData1[this.size].fkqd.length <= 0
          ) {
            window.globalUiKit.notify("提示", "请输入放款渠道", "error");
            return;
          }
          if (
            !this.overPaymentClaimData1[this.size].claAmt &&
            this.overPaymentClaimData1[this.size].claAmt.length <= 0
          ) {
            window.globalUiKit.notify("提示", "请输入认领金额", "error");
            return;
          }

          var params = {};
          params.remitName = this.objFormClaim1.remitName; //汇款人名称
          params.remitAcc = this.objFormClaim1.remitAcc; //汇款人账号
          params.gatAcc = ""; //收款账号
          params.idNo = this.overPaymentClaimData1.idNo; //认领人证件号码
          params.claAmt = this.overPaymentClaimData1.claAmt; //认领金额
          params.remitDt = this.objFormClaim1.remitDt; //汇款日期
          params.remitKey = this.overPaymentClaimData1.fkqd; //渠道认领主键
          claimCMIS200063(params)
            .then((res) => {
              console.log(res);
              if (res.retCode === "200") {
                console.log("测试测试测试");
                //业务逻辑处理：
                if (res.data.ec === "0000") {
                  window.globalUiKit.notify(
                    "提示",
                    "个人 溢缴款认领成功",
                    "success"
                  );
                  //调用 关闭 方法，返回查询页面，清空申请表单
                  this.claim_Shut_Personal();
                  //查询页面重新调用查询方法（没有提供，先不调用了）
                  //this.queryInfo()
                } else {
                  window.globalUiKit.notify(
                    "提示",
                    "个人 溢缴款认领未成功，请联系管理员",
                    "error"
                  );
                }
              } else {
                window.globalUiKit.notify(
                  "提示",
                  "个人 溢缴款认领未成功，请联系管理员",
                  "error"
                );
              }
            })
            .catch((err) => {
              console.log("个人 溢缴款认领发生异常:" + err);
            });
        } else {
          console.log("有必填项没有填写");
          return false;
        }
      });
    },
    //溢缴款认领(个人) 关闭
    claim_Shut_Personal() {
      this.vif_overPaymentCliam1 = false;
      this.vif_overPaymentList = true;
      this.vif_overPaymentCliam2 = false;
      this.overPaymentClaimData1 = [];
      this.objFormClaim1 = {};
    },

    //溢缴款认领(集团) 添加
    add2() {
      this.overPaymentClaimData2.push({
        khh: "",
        khmc: "",
        zjlx: "",
        idNo: "",
        sjhm: "",
        jjh: "",
        fkqd: "",
        claAmt: "",
        hkje: "",
        rlfs: "",
        zt: "",
        editing: true,
      });
      this.size2 = this.overPaymentClaimData2.length - 1;
    },
    //溢缴款认领(集团) 保存
    claim_Save_Group() {},
    //溢缴款认领(集团) 提交
    claim_Submit_Group() {
      console.log("溢缴款认领__集团");
      this.$refs["objFormClaim2"].validate((valid) => {
        if (valid) {
          console.log(this.size2);
          console.log(this.overPaymentClaimData2[this.size2].idNo);
          if (
            !this.overPaymentClaimData2[this.size2].idNo &&
            this.overPaymentClaimData2[this.size2].idNo.length <= 0
          ) {
            window.globalUiKit.notify("提示", "请输入认领人证件号码", "error");
            return;
          }

          if (
            !this.overPaymentClaimData2[this.size2].claAmt &&
            this.overPaymentClaimData2[this.size2].claAmt.length <= 0
          ) {
            window.globalUiKit.notify("提示", "请输入认领金额", "error");
            return;
          }

          var params = {};
          params.remitName = this.objFormClaim2.remitName; //汇款人名称
          params.remitAcc = this.objFormClaim2.remitAcc; //汇款人账号
          params.gatAcc = ""; //收款账号
          params.idNo = this.overPaymentClaimData2List.idNo; //认领人证件号码
          params.claAmt = this.overPaymentClaimData2List.claAmt; //认领金额
          params.remitDt = this.objFormClaim2.remitDt; //汇款日期
          params.remitKey = this.generateUniqueID(); //渠道认领主键

          queryRepayAccount();

          claimCMIS200063(params)
            .then((res) => {
              console.log(res);
              if (res.retCode === "200") {
                console.log("测试测试测试");
                //业务逻辑处理：
                if (res.data.ec === "0000") {
                  window.globalUiKit.notify(
                    "提示",
                    "集团 溢缴款认领成功",
                    "success"
                  );
                  //调用 关闭 方法，返回查询页面，清空申请表单
                  this.claim_Shut_Group();
                  //查询页面重新调用查询方法（没有提供，先不调用了）
                  //this.queryInfo()
                } else {
                  window.globalUiKit.notify(
                    "提示",
                    "集团 溢缴款认领未成功，请联系管理员",
                    "error"
                  );
                }
              } else {
                window.globalUiKit.notify(
                  "提示",
                  "集团 溢缴款认领未成功，请联系管理员",
                  "error"
                );
              }
            })
            .catch((err) => {
              console.log("集团 溢缴款认领发生异常:" + err);
            });
        }
      });
    },
    //溢缴款认领(集团) 关闭
    claim_Shut_Group() {
      this.vif_overPaymentCliam2 = false;
      this.vif_overPaymentList = true;
      this.vif_overPaymentCliam1 = false;
      this.overPaymentClaimData2 = [];
      this.objFormClaim2 = {};
    },

    //获取年月日加八位随机数
    generateUniqueID() {
      const date = new Date();
      const year = date.getFullYear();
      const month = (date.getMonth() + 1).toString().padStart(2, "0");
      const day = date.getDate().toString().padStart(2, "0");
      const random = Math.random().toString(36).substring(2, 10); // 获取8位随机数
      return `${year}${month}${day}${random}`;
    },

    //溢缴款查询列表——切换每页条数
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    //溢缴款查询列表——切换当前页
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },

    //溢缴款认领查询（个人）——切换每页条数
    handleSizeChange_Claim1(val) {},
    //溢缴款认领查询（集团）——切换当前页
    handleCurrentChange_Claim1(val) {},

    //溢缴款认领查询（个人）——切换每页条数
    handleSizeChange_Claim2(val) {},
    //溢缴款认领查询（集团）——切换当前页
    handleCurrentChange_Claim2(val) {},
  },
};
</script>

  <style scoped>
.overPaymentList .el-form-item {
  width: 282.5px;
}

.overPaymentClaimPersonal .el-col {
  margin-top: 10px;
}
</style>
